<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>树组件</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="../../layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="../../css/public.css"/>

	<body>
		
		<div class="layui-form mod_default_box ">
				<div id="moudletreeText"></div>

		</div>


		<script src="../../layui/layui.all.js"></script>
		<script>
			layui.use(['jquery', 'form', 'tree', 'layer', 'util'], function(exports) {
				var form = layui.form,
					$ = layui.jquery,
					tree = layui.tree,
					util = layui.util,
					index = 100;

				$.ajax({
					url: 'tree.json',
					type: 'get',
					dataType: 'json',
					success: function(data1) {
						tree.render({
							elem: '#moudletreeText',
							data: data1,
							onlyIconControl: true,
							edit: ['add', 'update', 'del'],
							click: function(node) {
								var data = node.data; 
								layer.msg(data.title)
							},
							oncheck: function(obj) {
								console.log(obj);
							},
						});

					}
				});



			});
		</script>

	</body>
</html>
